﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

namespace SuperX.DataService
{
    public enum DataSource
    {
        Cache = 1,
        Device = 2
    }

    public enum DataType : byte
    {
        SHORT = 4,
        BOOL = 1,
        BYTE = 3,
        WORD = 5,
        DWORD = 6,
        INT = 7,
        FLOAT = 8,
        STR = 11,
        DYNAMIC = 12,
    }

    /// <summary>
    /// 物联状态
    /// </summary>
    public enum IotState
    {
        Online = 0,
        Offline = 1,
        Unknown = 2,
    }

    /// <summary>
    /// 运行状态
    /// </summary>
    public enum RunningState
    {
        Run = 0,
        Pause = 1,
        Pragmatic = 2,
        PowerOff = 3,
        fault = 4,
        adjust = 5,
        Offline = 6
    }

    /// <summary>
    /// 报警状态
    /// </summary>
    public enum AlarmState
    {
        Normal = 0,
        Alarm = 1,
        Breakdown = 2,
    }

    /// <summary>
    /// 数据位顺序
    /// </summary>
    [Flags]
    public enum ByteOrder : byte
    {
        None = 0,
        BigEndian = 1,
        LittleEndian = 2,
        Network = 4,
        Host = 8
    }

    public enum ReadWriteMode
    {
        ReadWrite,
        ReadOnly,
        WriteOnly
    }

    public enum WorkStateType
    {
        Wait = 0,
        Running = 1,
        Stop = 2,
    }

    public enum TagConvertType
    {
        None,

        [Description("线性转换")]
        Scale,

        [Description("表达式")]
        Expression,

        [Description("BCD")]
        BCD,
    }
}